﻿/**
 * @file Log.cc
 * @brief 日志
 * $Id: Log.cc 13 2011-01-01 11:48:27Z tonyjobmails $
 * $Date: 2011-01-01 11:48:27 +0000 (Sat, 01 Jan 2011) $
 * $Author: tonyjobmails $
 * $Revision: 13 $
 */

#include <strings.h>
#include "Log.h"

namespace log
{
	void logger(const std::string &str)
	{
		_LOG(str);
	}
		
	void _ERROR_LOG(const char *str, ...)
	{
		char buff[4096 + 1];		/// 最高4096个字符
		bzero(buff, sizeof(buff));
		getMessage(buff, sizeof(buff), str);
		logger("[ERROR] " + std::string(buff));
	}
	
	void _DEBUG_LOG(const char *str, ...)
	{
		char buff[4096 + 1];		/// 最高4096个字符
		bzero(buff, sizeof(buff));
		getMessage(buff, sizeof(buff), str);
		logger("[DEBUG] " + std::string(buff));
	}
};
